package com.power.sifa.approve.api;

import com.plf.common.domain.ResponseDTO;
import com.power.sifa.approve.model.Aprv_materials_options;
import com.power.sifa.approve.model.pageInfo.Aprv_materials_optionsPageInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 *  表单输入动态生成的材料文件 Feign
 */
public interface IAprv_materials_optionsFeign {

    /**
     * 表单输入动态生成的材料文件分页列表
     */
    @PostMapping("/aprv_materials_options/list")
    ResponseDTO list(@RequestBody Aprv_materials_optionsPageInfo aprv_materials_optionsPageInfo);

    /**
    * 查看表单输入动态生成的材料文件
    */
    @GetMapping("/aprv_materials_options/view")
    ResponseDTO view(@RequestParam("id") String id);

    /**
    * 删除表单输入动态生成的材料文件
    */
    @PostMapping("/aprv_materials_options/delete")
    ResponseDTO delete(@RequestParam("id") String id);

    ///**
    // * 查看表单输入动态生成的材料文件 复合主键使用
    // */
    //@PostMapping("/aprv_materials_options/viewByPK")
    //ResponseDTO viewByPK(@RequestBody Aprv_materials_options.Aprv_materials_optionsPK pk);

    /**
     * 修改或保存表单输入动态生成的材料文件
     */
    @PostMapping("/aprv_materials_options/save")
    ResponseDTO save(@RequestBody Aprv_materials_options aprv_materials_options);

    ///**
    // * 删除表单输入动态生成的材料文件 复合主键使用
    // */
    //@PostMapping("/aprv_materials_options/deleteByPK")
    //ResponseDTO deleteByPK(@RequestBody Aprv_materials_options.Aprv_materials_optionsPK pk);
    
    /**
     * 批量删除表单输入动态生成的材料文件
     */
    @PostMapping("/aprv_materials_options/batchDel")
    ResponseDTO batchDel(@RequestParam("ids") String ids);
    
     /**
     * 导出excel
     */
    @PostMapping("/aprv_materials_options/output")
    void output(HttpServletResponse response, @RequestBody Aprv_materials_optionsPageInfo aprv_materials_optionsPageInfo);
        
     /**
     * 导出excel模板
     */
    @PostMapping("/aprv_materials_options/exportExcelTemplate")
    void exportExcelTemplate(HttpServletResponse response);
    
     /**
     *	导入excel
     */
    @PostMapping("/aprv_materials_options/importExcel")
    ResponseDTO importExcel(@RequestBody MultipartFile file) throws IOException ;



    /**
     * FIXME: 之前用于表单编辑预览，后被在线编辑替代(弃用)
     * 查看表单输入动态生成的材料文件
     */
    @PostMapping("/aprv_materials_options/findAllOptionsByApplyid")
    ResponseDTO findAllOptionsByApplyid(@RequestParam("applyid") String applyid);


    /**
     * 通过材料文件的id查询对应的历史版本数据
     * @param materialIds
     * @return
     */
    @PostMapping("/aprv_materials_options/findOldOptionMaterialMap")
    ResponseDTO findOldOptionMaterialMap(@RequestBody List<String> materialIds);
    
}
